<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

//Route::get('/', function () {
//    return view('welcome');
//});

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/

Route::group(['middleware' => ['web']], function () {

    //   代理
    Route::group(['domain'=>'agent.com'],function(){

        Route::group(['namespace'=>'Agent'],function(){

            Route::get('/','User\LoginController@login');
            Route::post('/login','User\LoginController@do_login');

            Route::group(['middleware'=>'Login'],function(){
                Route::get('/index','Index\IndexController@index');
                Route::get('/sumary','Index\IndexController@sumary');
                Route::get('/agent','Index\IndexController@agent');
                Route::get('/other','Index\IndexController@other');
                Route::get('/logout','Index\IndexController@logout');
            });
        });
    });



    //  名师
    Route::group(['domain'=>'expert.com'],function(){

        Route::group(['namespace'=>'Expert'],function(){
            Route::get('/','User\LoginController@login');
            Route::post('/login','User\LoginController@do_login');
            Route::get('/index','Index\IndexController@index');
            Route::get('/lesson','Index\IndexController@lesson');
            Route::get('/logout','Index\IndexController@logout');
        });
    });



    //  教育局
    Route::group(['domain'=>'teacher.com'],function(){
        Route::group(['namespace'=>'Teacher'],function(){

            Route::get('/','User\LoginController@login');

        });
    });



});
